<?
$P = db_array($_POST);
enforce_login();
if($_REQUEST['friendid'] && !is_number($_REQUEST['friendid'])) {
	error(404);
}
switch($_REQUEST['action']) {
	case 'add':
		include(SERVER_ROOT.'/sections/friends/add.php');
		break;
	case 'Defriend':
		include(SERVER_ROOT.'/sections/friends/remove.php');
		break;
	case 'Update':
		include(SERVER_ROOT.'/sections/friends/comment.php');
		break;
	case 'whois':
		include(SERVER_ROOT.'/sections/friends/whois.php');
		break;
	case 'Contact':
		header('Location: inbox.php?action=compose&to='.$_POST['friendid']);
		break;
	default:
		include(SERVER_ROOT.'/sections/friends/friends.php');
	
}
?>
